<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/transport_contract_tracking/transport_contract_tracking.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/demo/transport_contract_tracking/transport_contract_tracking.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'Tranid',
            footer: "Foots",
            cnName: '承运合同追踪',
            name: 'transport_contract_tracking/transport_contract_tracking',
            url: "/setpath/api/transport_contract_tracking/",
            sortName: "signing_date"
        });
        const editFormFields = ref({ "contract_number": "", "contract_title": "", "outsourcing_unit": "", "outsourcing_responsible_person": "", "line_name": "", "ton_price": "", "chartered_condition_tonnage": "", "chartered_amount": "", "signing_date": "", "creation_time": "", "abnormal_alarm": "", "freight_status": "", "ISDel": "" });
        const editFormOptions = ref([[{ "title": "合同编号", "field": "contract_number" }],
        [{ "title": "合同标题", "field": "contract_title" }],
        [{ "title": "外协单位", "field": "outsourcing_unit" }],
        [{ "title": "外协负责人", "field": "outsourcing_responsible_person" }],
        [{ "title": "线路名称", "field": "line_name" }],
        [{ "title": "吨运价", "field": "ton_price", "type": "decimal" }],
        [{ "title": "包车条件吨位", "field": "chartered_condition_tonnage", "type": "number" }],
        [{ "title": "包车金额", "field": "chartered_amount", "type": "number" }],
        [{ "title": "签订日期", "field": "signing_date" }],
        [{ "title": "创建时间", "required": true, "field": "creation_time" }],
        [{ "title": "异常报警", "field": "abnormal_alarm" }],
        [{ "title": "货运状态", "field": "freight_status" }],
        [{ "title": "逻辑删除字段", "field": "ISDel", "type": "number" }]]);
        const searchFormFields = ref({});
        const searchFormOptions = ref([]);
        const columns = ref([{ field: 'contract_number', title: '合同编号', type: 'string', width: 220, align: 'left', sort: true },
        { field: 'contract_title', title: '合同标题', type: 'string', width: 220, align: 'left' },
        { field: 'outsourcing_unit', title: '外协单位', type: 'string', width: 220, align: 'left' },
        { field: 'outsourcing_responsible_person', title: '外协负责人', type: 'string', width: 220, align: 'left' },
        { field: 'line_name', title: '线路名称', type: 'string', width: 220, align: 'left' },
        { field: 'ton_price', title: '吨运价', type: 'decimal', width: 110, align: 'left' },
        { field: 'chartered_condition_tonnage', title: '包车条件吨位', type: 'int', width: 110, align: 'left' },
        { field: 'chartered_amount', title: '包车金额', type: 'int', width: 110, align: 'left' },
        { field: 'signing_date', title: '签订日期', type: 'datetime', width: 150, align: 'left', sort: true },
        { field: 'creation_time', title: '创建时间', type: 'datetime', width: 150, require: true, align: 'left', sort: true },
        { field: 'abnormal_alarm', title: '异常报警', type: 'string', width: 220, align: 'left' },
        { field: 'freight_status', title: '货运状态', type: 'string', width: 220, align: 'left' },
        { field: 'ISDel', title: '逻辑删除字段', type: 'int', width: 110, align: 'left' },
        { field: 'operators', title: '经办人，字符串类型，最大长度 255 个字符', type: 'string', width: 120, align: 'left' },
        { field: 'Tranid', title: '自增的主键，用于唯一标识每条记录', type: 'string', width: 120, hidden: true, readonly: true, require: true, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
